angular.module("httpService2",[]).
service("mapService",function($http,$q){
    return {
         getSeatMapData:function(){
            var deferred=$q.defer();
            var promise=deferred.promise;
            $http({
                url:'/ticket/map/getSeatMapData',
            }).success(function(response){
                if (response.status==1001) {
                    deferred.resolve(response.body);
                };
            });
            return promise;
        }, 
        insert:function(data){
            var deferred=$q.defer();
            var promise=deferred.promise;
            $http({
                url:'/ticket/notice/insert',
                method:'post',
                data:angular.toJson(data)
            }).success(function(response){
                if (response.status==1001) {
                    deferred.resolve(response.body);
                };
            });
            return promise;
        },
          delete:function(data){
            var deferred=$q.defer();
            var promise=deferred.promise;
            $http({
                url:'/ticket/notice/delete',
                method:'post',
                data:data
            }).success(function(response){
                if (response.status==1001) {
                    deferred.resolve(response.body);
                };
            });
            return promise;
        },
         getByCount:function(data){
            var deferred=$q.defer();
            var promise=deferred.promise;
            $http({
                url:'/ticket/notice/getByCount',
                method:'post',
                data:data
            }).success(function(response){
                if (response.status==1001) {
                    deferred.resolve(response.body);
                };
            });
            return promise;
        },
        getAll:function(){
            var deferred=$q.defer();
            var promise=deferred.promise;
            $http({
                url:'/ticket/notice/getAll',
            }).success(function(response){
                if (response.status==1001) {
                    deferred.resolve(response.body);
                };
            });
            return promise;
        }
    };
});